package com.hl.springboot4.schedule;

import com.hl.springboot4.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @ClassName TestSH
 * @Description TODO
 * @Author libowen
 * @Date 2025年03月06日 15:11
 * @Version 1.0
 */
//@Component   // 创建对象放入到ioc容器中
public class TestSH {
    @Autowired
    private UserService userService;

//    @Scheduled(cron = "0/6 * * * * ?")
    @Scheduled(fixedRate = 3000)
    public void test(){
        System.out.println("你好，我是一个定时6秒执行的任务");
        // 调用业务层方法
    }


}
